/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.sd.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeesite.common.entity.Page;
import com.jeesite.common.service.CrudService;
import com.jeesite.modules.sd.entity.MsgManager;
import com.jeesite.modules.sd.dao.MsgManagerDao;
import org.springframework.transaction.event.TransactionalEventListener;

/**
 * 消息管理，记录短信发送信息Service
 * @author ysj
 * @version 2020-08-03
 */
@Service
@Transactional(readOnly=true)
public class MsgManagerService extends CrudService<MsgManagerDao, MsgManager> {

	@Autowired
	private MsgManagerDao msgManagerDao;
	
	/**
	 * 获取单条数据
	 * @param msgManager
	 * @return
	 */
	@Override
	public MsgManager get(MsgManager msgManager) {
		return super.get(msgManager);
	}
	
	/**
	 * 查询分页数据
	 * @param msgManager 查询条件
	 * @return
	 */
	@Override
	public Page<MsgManager> findPage(MsgManager msgManager) {
		return super.findPage(msgManager);
	}
	
	/**
	 * 保存数据（插入或更新）
	 * @param msgManager
	 */
	@Override
	@Transactional(readOnly=false)
	public void save(MsgManager msgManager) {
		super.save(msgManager);
	}
	
	/**
	 * 更新状态
	 * @param msgManager
	 */
	@Override
	@Transactional(readOnly=false)
	public void updateStatus(MsgManager msgManager) {
		super.updateStatus(msgManager);
	}
	
	/**
	 * 删除数据
	 * @param msgManager
	 */
	@Override
	@Transactional(readOnly=false)
	public void delete(MsgManager msgManager) {
		super.delete(msgManager);
	}

	/**
	 * 修改短信的状态
	 * @param msgManager
	 */
	@Transactional
	public void updataMsgStatue(MsgManager msgManager){ msgManagerDao.updataMsgStatue(msgManager); }

	/**
	 * 每次从数据库中取出一条短信生成完二维码
	 * @param msgManager
	 * @return
	 */
	@Transactional
	public MsgManager getMsgOne(MsgManager msgManager) {
		return msgManagerDao.getMsgOne(msgManager); }
	
}